<table id="tbl-map" cellspacing="0" cellpadding="0">
	<thead>
		<th>#</th>
			<?php for($x = 0; $x < $this->gameProperties->mapsSizeX; $x++) { ?>
				<th><?php echo($x + 1); ?></th>
			<?php } ?>		
	</thead>
	<tbody>
		<?php for($y = 0; $y < $this->gameProperties->mapsSizeY; $y++) { ?>
			<tr>
				<th><?php echo($y + 1)?></th>
				<?php for($x = 0; $x < $this->gameProperties->mapsSizeX; $x++) { ?>
					<?php $htmlId = ($x + 1) . 'x' . ($y + 1); ?>
					<td id="tile-<?php echo $htmlId; ?>">
						<dl class="inline">
							<dt>Feld:</dt>
							<dd><?php echo $this->escape($htmlId); ?></dd>
				
							<?php if(array_key_exists($htmlId, $this->tiles)) { ?>
								<dt>Geländetyp:</dt>
								<dd><?php echo $this->escape($this->tiles[$htmlId]->type->name); ?></dd>							
							
								<?php if($this->tiles[$htmlId]->resources !== null && count($this->tiles[$htmlId]->resources) > 0) { ?>
									<dt>Resourcen:</dt>
									<dd>
										<?php
											$arr = array();
											foreach($this->tiles[$htmlId]->resources as $resource) {
												$url		= $this->url(array('tileId' => $this->tiles[$htmlId]->id, 'resourceId' => $resource->id), 'MapsTileResource');
												$arr[]	= '<a href="' . $url . '">' . $this->escape($resource->name) . '</a> (' . $this->escape($resource->curValue) . ')';
											}

											echo implode(', ', $arr);
										?>
									</dd>
								<?php } ?>
									
								<?php if($this->tiles[$htmlId]->objects !== null && count($this->tiles[$htmlId]->objects) > 0) { ?>
									<dt>Objekte:</dt>
									<dd>
										<?php
											$arr = array();
											foreach($this->tiles[$htmlId]->objects as $object) {
												$type		= strtolower(str_replace(' ', '-', $object->type->name));
												$url		= $this->url(array('controller' => $type, 'objectId' => $object->id), 'Object');
												$arr[]	= '<a href="' . $url . '">' . $this->escape($object->name) . '</a>';
											}

											echo implode(', ', $arr);
										?>
									</dd>
								<?php } ?>									
								
							<?php } ?>
						</dl>
					</td>		
				<?php } ?>
			</tr>
		<?php }	?>	
	</tbody>
</table>